package ysq.xyg.recovery.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 回收金模块-回收商圈实体类
 *
 * @author congcong tao
 * @date 2019-8-1 15:02:22
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_recovery_circle")
public class RecoveryCircle implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 会员，一个用户id只有一个
     */ 
	@Column(name = "member_id")
	private String memberId;

	/**
     * 分类，code码，1=废金属2=废家电3=废塑料4=废包装
     */ 
	@Column(name = "cat_code")
	private String catCode;

	/**
	 * 所在区域
	 */
	@Column(name = "area")
	private String area;

	/**
     * 公司名称
     */ 
	@Column(name = "company_name")
	private String companyName;

	/**
	 * 联系人
	 */
	@Column(name = "name")
	private String name;

	/**
	 * 经营范围
	 */
	@Column(name = "business_scope")
	private String businessScope;

	/**
     * 联系方式
     */ 
	@Column(name = "phone")
	private String phone;

	/**
     * 地址
     */ 
	@Column(name = "address")
	private String address;

	/**
     * 回收内容
     */ 
	@Column(name = "content")
	private String content;

	/**
     * 图片
     */ 
	@Column(name = "image")
	private String image;

	/**
     * 是否已同意1=审核中2=已通过3=未通过
     */ 
	@Column(name = "status")
	private String status;

	/**
     * 处理原因
     */ 
	@Column(name = "manage_content")
	private String manageContent;

	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private String memberCardNo;

	@Transient
	private String memberNickName;

	@Transient
	private String areaName;

	public RecoveryCircle(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}